package com.txts.road.app.message.model.dto;

import java.io.Serial;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;

/**
 * 消息表单对象
 *
 * @author baoyr
 * @since 2025-07-17 10:46
 */
@Getter
@Setter
@Schema(description = "消息表单对象")
public class MessageDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "消息ID")
    @NotNull(message = "消息ID不能为空")
    private Long id;

    @Schema(description = "会话ID")
    @NotNull(message = "会话ID不能为空")
    private Long sessionId;

    @Schema(description = "发送者ID")
    @NotNull(message = "发送者ID不能为空")
    private Long senderId;

    @Schema(description = "接收者ID")
    @NotNull(message = "接收者ID不能为空")
    private Long receiverId;

    @Schema(description = "消息类型：1-文字，2-语音，3-位置，4-系统消息")
    @NotNull(message = "消息类型：1-文字，2-语音，3-位置，4-系统消息不能为空")
    private Integer messageType;

    @Schema(description = "消息内容")
    @Size(max=65535, message="消息内容长度不能超过65535个字符")
    private String content;

    @Schema(description = "扩展数据(位置信息等)")
    private String extraData;

    @Schema(description = "是否已读：0-未读，1-已读")
    private Integer isRead;

    @Schema(description = "发送时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sendTime;


}
